<%@ page import="java.util.HashMap,common.CommonUtil,java.util.*,common.*,db.QueryManager" contentType="text/html; charset=utf-8" %>

<%
UserSession userSession = (UserSession)session.getAttribute("user"); 

//String login_id = null;
String user_id = null;
String level = null;

if(userSession!= null){
	//login_id = userSession.getLogin_id();
	user_id = userSession.getUser_id();
	level = userSession.getAdmin_level();
}

//페이징 처리 Start
String line_number	= CommonUtil.nvl(request.getParameter("line_number"));
String curr_page = CommonUtil.nvl(request.getParameter("curr_page"));
String total_count = CommonUtil.nvl(request.getParameter("total_count"));
String s_rating_state = CommonUtil.nvl(request.getParameter("rating_state"));
String search_combo = CommonUtil.nvl(request.getParameter("search_combo"));
String keyword = CommonUtil.nvl(request.getParameter("keyword"));

String start_date	= CommonUtil.nvl(request.getParameter("start_date"),""); 
String end_date	= CommonUtil.nvl(request.getParameter("end_date"),"");
//페이징 처리 End

String BASE_TS_GRADE = QueryManager.getQuery("ts.grade");
String[] ts_grade_arr = BASE_TS_GRADE.split("-");
int ts_grade_cnt = ts_grade_arr.length;

HashMap listMap=(HashMap)request.getAttribute("list_map");
HashMap map = null;
HashMap map1 = null;
HashMap map2 = null;
HashMap map3 = null;

ArrayList list=null;
ArrayList list1=null;
ArrayList list2=null;
ArrayList list3=null;

if (listMap!=null && listMap.size() >0){
	list=(ArrayList)listMap.get("mainContent");
	
	list1=(ArrayList)listMap.get("mainContent1");
	
	list2=(ArrayList)listMap.get("mainContent2");
	
	list3=(ArrayList)listMap.get("mainContent3");
}

String member_test_code 		= "";
String member_id 		= "";
String test_state 		= "";
String reg_dt 	= "";
String login_id_map 		= "";
String login_name 	= "";
String email	= "";
String cell_no	= "";

String rater_id 	= "";
String rating_state 		= "";
String rating_start_time 	= "";
String rating_close_time	= "";
String rating_reg_dt	= "";
String rater_name 	= "";

String rating_grade = "";
String rating_cont = "";

String rating_grade_cnt = "";

String avg_total	= "";

String cd = "";
String cd_nm = "";

String sign_code="";
String link_id="";

String q1_1 = "";
String q1_2 = "";
String q2_1 = "";
String q2_2 = "";
String q3_1 = "";
String q3_2 = "";
String q3_3 = "";
String q3_4 = "";
String q3_5 = "";
String q4_1 = "";
String q4_2 = "";
String q4_3 = "";
String q4_4 = "";
String q4_5 = "";
String q4_6 = "";
String q4_7 = "";
String q5_1 = "";
String q5_2 = "";
String q5_3 = "";
String q5_4 = "";
String q5_5 = "";
String q5_6 = "";
String q5_7 = "";
String q6_1 = "";
String q6_2 = "";
String q6_3 = "";
String q6_4 = "";
String q6_5 = "";
String q6_6 = "";
String q6_7 = "";
String q7_1 = "";
String q7_2 = "";
String q7_3 = "";
String q7_4 = "";
String q7_5 = "";
String q7_6 = "";
String q7_7 = "";
String q8_1 = "";
String q8_2 = "";
String q8_3 = "";
String q8_4 = "";
String q8_5 = "";
String q8_6 = "";
String q8_7 = "";
String q9_1 = "";
String q9_2 = "";
String q9_3 = "";
String q9_4 = "";
String q9_5 = "";
String q9_6 = "";
String q9_7 = "";
String q10_1 = "";
String q10_2 = "";
String q10_3 = "";
String q10_4 = "";
String q10_5 = "";
String q10_6 = "";
String q10_7 = "";
String q11_1 = "";
String q11_2 = "";
String q11_3 = "";
String q11_4 = "";
String q11_5 = "";
String q11_6 = "";
String q11_7 = "";

String part_total = "";

String part1_sum = "";	
String part1 = "";

String part2_sum = "";	
String part2 = "";

String part3_sum = "";	
String part3 = "";

String part4_sum = "";	
String part4 = "";

String part5_sum = "";	
String part5 = "";

String part6_sum = "";	
String part6 = "";

String result_view_yn = "";

if(list != null){
	if(list.size() > 0){
		
		login_id_map = CommonUtil.nvl(Crypto.DecodeBySType((String)((HashMap)list.get(0)).get("login_id")));
		
		member_test_code = CommonUtil.nvl((String)((HashMap)list.get(0)).get("member_test_code"));		
		member_id = CommonUtil.nvl((String)((HashMap)list.get(0)).get("member_id"));
		test_state = CommonUtil.nvl((String)((HashMap)list.get(0)).get("test_state"));
		reg_dt = CommonUtil.nvl((String)((HashMap)list.get(0)).get("reg_dt"));
		login_name = CommonUtil.nvl((String)((HashMap)list.get(0)).get("login_name"));
		
		email = CommonUtil.nvl((String)((HashMap)list.get(0)).get("email"));
		cell_no = CommonUtil.nvl((String)((HashMap)list.get(0)).get("cell_no"));
		rater_id = CommonUtil.nvl((String)((HashMap)list.get(0)).get("rater_id"));
		rating_state = CommonUtil.nvl((String)((HashMap)list.get(0)).get("rating_state"));
		rating_start_time = CommonUtil.nvl((String)((HashMap)list.get(0)).get("rating_start_time"));
		rating_close_time = CommonUtil.nvl((String)((HashMap)list.get(0)).get("rating_close_time"));
		rating_reg_dt = CommonUtil.nvl((String)((HashMap)list.get(0)).get("rating_reg_dt"));
		rater_name = CommonUtil.nvl((String)((HashMap)list.get(0)).get("rater_name"));
		
		sign_code = CommonUtil.nvl((String)((HashMap)list.get(0)).get("sign_code"));
		link_id = CommonUtil.nvl((String)((HashMap)list.get(0)).get("link_id"));
		
		q1_1 = CommonUtil.nvl((String)((HashMap)list.get(0)).get("1_1"));
		q1_2 = CommonUtil.nvl((String)((HashMap)list.get(0)).get("1_2"));
		q2_1 = CommonUtil.nvl((String)((HashMap)list.get(0)).get("2_1"));
		q2_2 = CommonUtil.nvl((String)((HashMap)list.get(0)).get("2_2"));
		q3_1 = CommonUtil.nvl((String)((HashMap)list.get(0)).get("3_1"));
		q3_2 = CommonUtil.nvl((String)((HashMap)list.get(0)).get("3_2"));
		q3_3 = CommonUtil.nvl((String)((HashMap)list.get(0)).get("3_3"));
		q3_4 = CommonUtil.nvl((String)((HashMap)list.get(0)).get("3_4"));
		q3_5 = CommonUtil.nvl((String)((HashMap)list.get(0)).get("3_5"));
		q4_1 = CommonUtil.nvl((String)((HashMap)list.get(0)).get("4_1"));
		q4_2 = CommonUtil.nvl((String)((HashMap)list.get(0)).get("4_2"));
		q4_3 = CommonUtil.nvl((String)((HashMap)list.get(0)).get("4_3"));
		q4_4 = CommonUtil.nvl((String)((HashMap)list.get(0)).get("4_4"));
		q4_5 = CommonUtil.nvl((String)((HashMap)list.get(0)).get("4_5"));
		q4_6 = CommonUtil.nvl((String)((HashMap)list.get(0)).get("4_6"));
		q4_7 = CommonUtil.nvl((String)((HashMap)list.get(0)).get("4_7"));
		q5_1 = CommonUtil.nvl((String)((HashMap)list.get(0)).get("5_1"));
		q5_2 = CommonUtil.nvl((String)((HashMap)list.get(0)).get("5_2"));
		q5_3 = CommonUtil.nvl((String)((HashMap)list.get(0)).get("5_3"));
		q5_4 = CommonUtil.nvl((String)((HashMap)list.get(0)).get("5_4"));
		q5_5 = CommonUtil.nvl((String)((HashMap)list.get(0)).get("5_5"));
		q5_6 = CommonUtil.nvl((String)((HashMap)list.get(0)).get("5_6"));
		q5_7 = CommonUtil.nvl((String)((HashMap)list.get(0)).get("5_7"));
		q6_1 = CommonUtil.nvl((String)((HashMap)list.get(0)).get("6_1"));
		q6_2 = CommonUtil.nvl((String)((HashMap)list.get(0)).get("6_2"));
		q6_3 = CommonUtil.nvl((String)((HashMap)list.get(0)).get("6_3"));
		q6_4 = CommonUtil.nvl((String)((HashMap)list.get(0)).get("6_4"));
		q6_5 = CommonUtil.nvl((String)((HashMap)list.get(0)).get("6_5"));
		q6_6 = CommonUtil.nvl((String)((HashMap)list.get(0)).get("6_6"));
		q6_7 = CommonUtil.nvl((String)((HashMap)list.get(0)).get("6_7"));
		q7_1 = CommonUtil.nvl((String)((HashMap)list.get(0)).get("7_1"));
		q7_2 = CommonUtil.nvl((String)((HashMap)list.get(0)).get("7_2"));
		q7_3 = CommonUtil.nvl((String)((HashMap)list.get(0)).get("7_3"));
		q7_4 = CommonUtil.nvl((String)((HashMap)list.get(0)).get("7_4"));
		q7_5 = CommonUtil.nvl((String)((HashMap)list.get(0)).get("7_5"));
		q7_6 = CommonUtil.nvl((String)((HashMap)list.get(0)).get("7_6"));
		q7_7 = CommonUtil.nvl((String)((HashMap)list.get(0)).get("7_7"));
		q8_1 = CommonUtil.nvl((String)((HashMap)list.get(0)).get("8_1"));
		q8_2 = CommonUtil.nvl((String)((HashMap)list.get(0)).get("8_2"));
		q8_3 = CommonUtil.nvl((String)((HashMap)list.get(0)).get("8_3"));
		q8_4 = CommonUtil.nvl((String)((HashMap)list.get(0)).get("8_4"));
		q8_5 = CommonUtil.nvl((String)((HashMap)list.get(0)).get("8_5"));
		q8_6 = CommonUtil.nvl((String)((HashMap)list.get(0)).get("8_6"));
		q8_7 = CommonUtil.nvl((String)((HashMap)list.get(0)).get("8_7"));
		q9_1 = CommonUtil.nvl((String)((HashMap)list.get(0)).get("9_1"));
		q9_2 = CommonUtil.nvl((String)((HashMap)list.get(0)).get("9_2"));
		q9_3 = CommonUtil.nvl((String)((HashMap)list.get(0)).get("9_3"));
		q9_4 = CommonUtil.nvl((String)((HashMap)list.get(0)).get("9_4"));
		q9_5 = CommonUtil.nvl((String)((HashMap)list.get(0)).get("9_5"));
		q9_6 = CommonUtil.nvl((String)((HashMap)list.get(0)).get("9_6"));
		q9_7 = CommonUtil.nvl((String)((HashMap)list.get(0)).get("9_7"));
		q10_1 = CommonUtil.nvl((String)((HashMap)list.get(0)).get("10_1"));
		q10_2 = CommonUtil.nvl((String)((HashMap)list.get(0)).get("10_2"));
		q10_3 = CommonUtil.nvl((String)((HashMap)list.get(0)).get("10_3"));
		q10_4 = CommonUtil.nvl((String)((HashMap)list.get(0)).get("10_4"));
		q10_5 = CommonUtil.nvl((String)((HashMap)list.get(0)).get("10_5"));
		q10_6 = CommonUtil.nvl((String)((HashMap)list.get(0)).get("10_6"));
		q10_7 = CommonUtil.nvl((String)((HashMap)list.get(0)).get("10_7"));
		q11_1 = CommonUtil.nvl((String)((HashMap)list.get(0)).get("11_1"));
		q11_2 = CommonUtil.nvl((String)((HashMap)list.get(0)).get("11_2"));
		q11_3 = CommonUtil.nvl((String)((HashMap)list.get(0)).get("11_3"));
		q11_4 = CommonUtil.nvl((String)((HashMap)list.get(0)).get("11_4"));
		q11_5 = CommonUtil.nvl((String)((HashMap)list.get(0)).get("11_5"));
		q11_6 = CommonUtil.nvl((String)((HashMap)list.get(0)).get("11_6"));
		q11_7 = CommonUtil.nvl((String)((HashMap)list.get(0)).get("11_7"));

		part_total = CommonUtil.nvl((String)((HashMap)list.get(0)).get("part_total"));
		
		avg_total = CommonUtil.nvl((String)((HashMap)list.get(0)).get("avg_total"));
		
		part1_sum = CommonUtil.nvl((String)((HashMap)list.get(0)).get("part1_per"));	
		part1 = CommonUtil.nvl((String)((HashMap)list.get(0)).get("part1"));
		
		part2_sum = CommonUtil.nvl((String)((HashMap)list.get(0)).get("part2_per"));	
		part2 = CommonUtil.nvl((String)((HashMap)list.get(0)).get("part2"));
		
		part3_sum = CommonUtil.nvl((String)((HashMap)list.get(0)).get("part3_per"));	
		part3 = CommonUtil.nvl((String)((HashMap)list.get(0)).get("part3"));
		
		part4_sum = CommonUtil.nvl((String)((HashMap)list.get(0)).get("part4_per"));	
		part4 = CommonUtil.nvl((String)((HashMap)list.get(0)).get("part4"));
		
		part5_sum = CommonUtil.nvl((String)((HashMap)list.get(0)).get("part5_per"));	
		part5 = CommonUtil.nvl((String)((HashMap)list.get(0)).get("part5"));
		
		part6_sum = CommonUtil.nvl((String)((HashMap)list.get(0)).get("part6_per"));	
		part6 = CommonUtil.nvl((String)((HashMap)list.get(0)).get("part6"));	
		
		result_view_yn = CommonUtil.nvl((String)((HashMap)list.get(0)).get("result_view_yn"));
		
	}
}

if(!rater_id.equals(user_id)&& level.equals("4")){
	out.println("<script>alert('Non authority.');history.back();</script>");
}
%>
<jsp:include page="/jsp/common/header.jsp"></jsp:include>
<script language='javascript' src="/js/ajaxutil.js"></script>

<script>



//xml 요청
function getXMLHTTPRequest() {
try {
req = new XMLHttpRequest();
} catch(err1) {
try {
req = new ActiveXObject("Msxml2.XMLHTTP");
} catch (err2) {
try {
req = new ActiveXObject("Microsoft.XMLHTTP");
} catch (err3) {
  req = false;
} 
} 
}
return req;
}


function get_rater_give_request(mc,ri,si,li){

var http = getXMLHTTPRequest();
var myurl = '/speaking.pb?gubun=ts&cmd=rater_give&member_test_code='+mc+'&rater_id='+ri+'&pay_code='+si+'&link_id='+li+'&test_state=2&rating_state=1';
myRand = parseInt(Math.random()*999999999999999);
var modurl = myurl+"&rand="+myRand;  
http.open("get", modurl, false);
//http.onreadystatechange = useHttpResponse;
http.send(null);
if (http.readyState == 4) {
return trim(http.responseText);
}else{
return "";
}
} 	

function trim(str){
	str = str.replace(/(^\s*)|(\s*$)/g,"");
	return str;
}

function get_rater_chk(mc,ri,si,li){
	var frm = document.mainform;
	
	if(!confirm('Allocate?')){
		return;
	}
	
	if(ri == ''){
		alert('Rater Select');		
	}
	var rater_chk = get_rater_give_request(mc,ri,si,li);
	
	alert('Allocate.');
	go_select()	;
	/*
	if(trim(rater_chk)=='OK'){
		
		alert('Allocate.');
		
		go_select()	;		
		
	}else{
		alert('problem');
	}
	*/
}

function go_select(){
	var frm = document.mainform;
	
	frm.cmd.value='tstest_select';
	frm.action = '/speaking.pb';
	frm.target= '_self';              
	frm.submit();	
}

function go_rerating(){
	var frm = document.mainform;
	if(confirm('UnRating ?')){
		unrating_comment.style.display = "block";
		if(frm.rerating_reason.value == ''){
			alert('UnRating reason insert');
			frm.rerating_reason.focus();
			return;
		}
		
		frm.cmd.value='tstest_rerating';
		frm.action = '/speaking.pb';
		frm.target= 'hidden_frm';              
		frm.submit();	
	}
}

function Mplayer_Player_Base(){
	var m_w, m_h;
	var tag;
	m_w = 0;
	m_h = 0;
	tag = "<OBJECT ID='MediaPlayer' Name='MediaPlayer' classid='clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95' codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701' standby='Loading Microsoft Windows Media Player components...' type='application/x-oleobject ' bgcolor='DarkBlue' width='"+ m_w +"' Height='"+ m_h +"' VIEWASTEXT style='FILTER:gray()'>"
                + "<PARAM NAME='AutoStart' VALUE='1'>"
                + "<PARAM NAME='AutoSize' VALUE='1'>"
                + "<PARAM NAME='AnimationAtStart' VALUE='0'>"
                + "<PARAM NAME='DisplayMode' VALUE='3'>"
                + "<PARAM NAME='Enabled' VALUE='1'>"
                + "<PARAM NAME='ShowControls' VALUE='1'>"
                + "<PARAM NAME='ShowAudioControls' VALUE='1'>"
                + "<PARAM NAME='ShowDisplay' VALUE='0'>"
                + "<PARAM NAME='ShowGotoBar' VALUE='0'>"
                + "<PARAM NAME='ShowPositionControls' VALUE='1'>"
                + "<PARAM NAME='ShowStatusBar' VALUE='0'>"
                + "<PARAM NAME='Volume' VALUE='50'>"
                + "<PARAM NAME='ShowCaptioning' VALUE='0'>"
                + "<PARAM NAME='TransparentAtStart' value='1'>"				
				+ "</OBJECT>";

	  document.write(tag);	 
	  
}
function Mplayer_Player(f){
MediaPlayer.Filename = f;
MediaPlayer.play();
}

function Mplayer_Player_stop(){
	MediaPlayer.stop();
}


function record_listen(record_file_url){
	//var test_url = "/speaking.pb?cmd=download2&file_id="+record_file_url+"&file_name="+record_file_url+"&file_folder=tstest";
	var test_url = "/uploads/tstest/"+record_file_url;
	Mplayer_Player(test_url);	
}

function explane_listen(explane_file_url){
	//var test_url = "/speaking.pb?cmd=download&file_id="+record_file_url+"&file_name="+record_file_url+"&file_folder=tstest";
	var test_url = "/uploads/tsexam/"+explane_file_url;
	Mplayer_Player(test_url);	
}

function record_stop(){
	Mplayer_Player_stop();
}

function go_download(id,name,folder){
	var frm = document.downform;	
	frm.cmd.value='download';
	frm.file_id.value=id;
	frm.file_name.value=name;
	frm.file_folder.value=folder;
	frm.action = '/speaking.pb';
	frm.target= '_self';              
	frm.submit();
}

function question_view(q){
	var dis = document.getElementById(q+'_view').style.display;
	if(dis == 'none'){
		document.getElementById(q+'_view').style.display = 'block';
	}else{
		document.getElementById(q+'_view').style.display = 'none';
	}
	
	for(var i=1;i<=<%=list1.size()%>;i++){
		if (i!= parseInt(q)){
			
			document.getElementById(i+'_view').style.display = 'none';
		}
	}
}

function question_result_sum(q){
	
	var question ;
	var part_sum = 0;
	var part_per = 0;
	var part1_total = 12;
	var part2_total = 15;
	var part3_total = 63;
	var part4_total = 63;
	var part5_total = 35;
	var part6_total = 35;
	
	if(q<=2){
		for(var g=1;g<=2;g++){
			for(var h=1;h<=2;h++){
				question = eval('document.mainform.q'+g+'_'+h);
				for(var i=0;i<=5;i++){
					if(question[i].checked == true ){
						part_sum = part_sum + parseInt(question[i].value);	
					}
				}
			}
		}
	}
	
	if(q==3){
		
		for(var h=1;h<=5;h++){
			question = eval('document.mainform.q'+q+'_'+h);
			for(var i=0;i<=5;i++){
				if(question[i].checked == true ){
					part_sum = part_sum + parseInt(question[i].value);	
				}
			}
		}
		
	}
	
	if(q>=4 && q<=6){
		for(var g=4;g<=6;g++){
			for(var h=1;h<=7;h++){
				question = eval('document.mainform.q'+g+'_'+h);
				for(var i=0;i<=5;i++){
					if(question[i].checked == true ){
						part_sum = part_sum + parseInt(question[i].value);	
					}
				}
			}
		}
	}
	
	if(q>=7 && q<=9){
		for(var g=7;g<=9;g++){
			for(var h=1;h<=7;h++){
				question = eval('document.mainform.q'+g+'_'+h);
				for(var i=0;i<=5;i++){
					if(question[i].checked == true ){
						part_sum = part_sum + parseInt(question[i].value);	
					}
				}
			}
		}
	}
	
	if(q==10 || q==11){
		
		for(var h=1;h<=7;h++){
			question = eval('document.mainform.q'+q+'_'+h);
			for(var i=0;i<=5;i++){
				if(question[i].checked == true ){
					part_sum = part_sum + parseInt(question[i].value);	
				}
			}
		}
		
	}
	
	if(q<=2){
		part_per = (part_sum / part1_total) * 100; 
		document.mainform.part1_sum.value = Math.round(part_per);
	}
	if(q==3){
		part_per = (part_sum / part2_total) * 100;
		document.mainform.part2_sum.value = Math.round(part_per);
	}
	if(q>=4 && q<=6){
		part_per = (part_sum / part3_total) * 100;
		document.mainform.part3_sum.value = Math.round(part_per);
	}
	if(q>=7 && q<=9){
		part_per = (part_sum / part4_total) * 100;
		document.mainform.part4_sum.value = Math.round(part_per);
	}
	if(q==10){
		part_per = (part_sum / part5_total) * 100;
		document.mainform.part5_sum.value = Math.round(part_per);
	}
	if(q==11){
		part_per = (part_sum / part6_total) * 100;
		document.mainform.part6_sum.value = Math.round(part_per);
	}	
	
	//alert(Math.round(part_per));
}

function rating_sum(){
	var rating_37 = ["0","3.3","6.6","9.9","13.2","16.5","19.8","23.1","26.4","29.7","33"];
	var rating_31 = ["0","2.8","5.6","8.4","11.2","14","16.8","19.6","22.4","25.2","28"];
	var rating_28 = ["0","2.5","5","7.5","10","12.5","15","17.5","20","22.5","25"];

	//alert(rating_37.length);
	
	var rater_1 = 0;
	var rater_2 = 0;
	var rater_3 = 0;
	var rater_4 = 0;
	var rater_5 = 0;
	var rater_6 = 0;
	var rater_7 = 0;
	var rater_sum = 0;
	
	for(var h=1;h<=7;h++){
		var question10 = eval('document.mainform.q10_'+h);
		var question11 = eval('document.mainform.q11_'+h);
		
		
		
		if(h==1){
			for(var i=0;i<=5;i++){
				if(question10[i].checked == true ){
					rater_1 =   parseInt(question10[i].value) ;	
				}
			}
			
			for(var i=0;i<=5;i++){
				if(question11[i].checked == true ){
					rater_1 =   rater_1 + parseInt(question11[i].value) ;	
				}
			}
			
			//alert(rating_37[rater_1]);
			rater_1 = rating_37[rater_1];
		}
		
		if(h==2){
			for(var i=0;i<=5;i++){
				if(question10[i].checked == true ){
					rater_2 =   parseInt(question10[i].value) ;	
				}
			}
			
			for(var i=0;i<=5;i++){
				if(question11[i].checked == true ){
					rater_2 =   rater_2 + parseInt(question11[i].value) ;	
				}
			}
			
			//alert(rating_37[rater_2]);
			rater_2 = rating_37[rater_2];
		}
		
		if(h==3){
			for(var i=0;i<=5;i++){
				if(question10[i].checked == true ){
					rater_3 =   parseInt(question10[i].value) ;	
				}
			}
			
			for(var i=0;i<=5;i++){
				if(question11[i].checked == true ){
					rater_3 =   rater_3 + parseInt(question11[i].value) ;	
				}
			}
			
			//alert(rating_31[rater_3]);
			rater_3 = rating_31[rater_3];
		}
		
		if(h==4){
			for(var i=0;i<=5;i++){
				if(question10[i].checked == true ){
					rater_4 =   parseInt(question10[i].value) ;	
				}
			}
			
			for(var i=0;i<=5;i++){
				if(question11[i].checked == true ){
					rater_4 =   rater_4 + parseInt(question11[i].value) ;	
				}
			}
			
			//alert(rating_31[rater_4]);
			rater_4 = rating_31[rater_4];
		}
		
		if(h==5){
			for(var i=0;i<=5;i++){
				if(question10[i].checked == true ){
					rater_5 =   parseInt(question10[i].value) ;	
				}
			}
			
			for(var i=0;i<=5;i++){
				if(question11[i].checked == true ){
					rater_5 =   rater_5 + parseInt(question11[i].value) ;	
				}
			}
			
			//alert(rating_31[rater_5]);
			rater_5 = rating_31[rater_5];
		}
		
		if(h==6){
			for(var i=0;i<=5;i++){
				if(question10[i].checked == true ){
					rater_6 =   parseInt(question10[i].value) ;	
				}
			}
			
			for(var i=0;i<=5;i++){
				if(question11[i].checked == true ){
					rater_6 =   rater_6 + parseInt(question11[i].value) ;	
				}
			}
			
			//alert(rating_28[rater_6]);
			rater_6 = rating_28[rater_6];
		}
		
		if(h==7){
			for(var i=0;i<=5;i++){
				if(question10[i].checked == true ){
					rater_7 =   parseInt(question10[i].value) ;	
				}
			}
			
			for(var i=0;i<=5;i++){
				if(question11[i].checked == true ){
					rater_7 =   rater_7 + parseInt(question11[i].value) ;	
				}
			}
			
			//alert(rating_28[rater_7]);
			rater_7 = rating_28[rater_7];
		}
	}
	
	rater_sum = parseInt(rater_1)+parseInt(rater_2)+parseInt(rater_3)+parseInt(rater_4)+parseInt(rater_5)+parseInt(rater_6)+parseInt(rater_7);
	
	//alert(rater_sum);
	
	document.mainform.part_total.value = rater_sum;
}

function go_input(){
	var frm = document.mainform;
	var part_sum = 0;
	//document.mainform.part_total.value = 0 ;
	for(var q=1;q<=11;q++){
		/*
		if(q<=2){
			for(var h=1;h<=2;h++){
				question = eval('document.mainform.q'+q+'_'+h);
				for(var i=0;i<=5;i++){
					if(question[i].checked == true ){
						part_sum = part_sum + 1;
						document.mainform.part_total.value =   parseInt(question[i].value) + parseInt(document.mainform.part_total.value);	
					}
				}
			}
		}
		
		if(q==3){
			
			for(var h=1;h<=5;h++){
				question = eval('document.mainform.q'+q+'_'+h);
				for(var i=0;i<=5;i++){
					if(question[i].checked == true ){
						part_sum = part_sum + 1;
						document.mainform.part_total.value =   parseInt(question[i].value) + parseInt(document.mainform.part_total.value);	
					}
				}
			}
			
		}
		
		if(q>=4 ){
			for(var h=1;h<=7;h++){
				question = eval('document.mainform.q'+q+'_'+h);
				for(var i=0;i<=5;i++){
					if(question[i].checked == true ){
						part_sum = part_sum + 1;
						document.mainform.part_total.value =   parseInt(question[i].value) + parseInt(document.mainform.part_total.value);	
					}
				}
			}
		}
		*/
		
		/*if(q>=10 ){
			for(var h=1;h<=7;h++){
				question = eval('document.mainform.q'+q+'_'+h);
				for(var i=0;i<=5;i++){
					if(question[i].checked == true ){
						part_sum = part_sum + 1;
					}
				}
			}
		}*/
	}
	
	/*
	if(part_sum<65){
		alert('all check false');
		return;
	}
	*/
	
	/*if(part_sum<14){
		alert('all check false');
		return;
	}*/
	
	/*
	if(frm.part1.value == ''){
		alert('part1 comment insert');
		frm.part1.focus();
		return;
	}
	
	if(frm.part2.value == ''){
		alert('part2 comment insert');
		frm.part2.focus();
		return;
	}
	
	if(frm.part3.value == ''){
		alert('part3 comment insert');
		frm.part3.focus();
		return;
	}
	
	if(frm.part4.value == ''){
		alert('part4 comment insert');
		frm.part4.focus();
		return;
	}
	
	if(frm.part5.value == ''){
		alert('part5 comment insert');
		frm.part5.focus();
		return;
	}
	
	if(frm.part6.value == ''){
		alert('part6 comment insert');
		frm.part6.focus();
		return;
	}
	*/
		
	frm.action = '/speaking.pb?cmd=tstest_modify';
	frm.target= 'hidden_frm';              
	frm.submit();	
}


function go_tstest(){
	
	var frm = document.moveform;	
	frm.cmd.value='tstest_main';
	frm.action = '/speaking.pb';
	frm.target= '_self';              
	frm.submit();
	
}
</script>

<SCRIPT FOR="MediaPlayer" EVENT="EndOfStream(mState)" LANGUAGE="JavaScript"> 
if (mState == 0)
{
	if(MediaPlayer.PlayCount==1)
	{
		alert("Play Stop");
	}
}
</SCRIPT>

<jsp:include page="/jsp/common/top.jsp"></jsp:include>
<jsp:include page="/jsp/common/submenu.jsp"><jsp:param name="submenu_id" value="tstest_main" /><jsp:param name="submenu_idx" value="1" /></jsp:include>

<form name="mainform"  method="post" action = "/speaking.pb" >
	<div id="bodyContainer">
        <div id="contents">
          <jsp:include page="/jsp/common/submenu_list.jsp"><jsp:param name="submenu_id" value="tstest_main" /><jsp:param name="submenu_idx" value="2" /></jsp:include>
          
          
          <div class="boxContainer">
            <dl title="Status of Tests and Ratings">
              <dt>Status of Tests and Ratings</dt>
            </dl>
            <table class="setupTb">
              <tr>
                <th>ID</th>
                <td><%=login_id_map %></td>
              </tr>
              <tr>
                <th>Name</th>
                <td><%=login_name %></td>
              </tr>
              <tr>
                <th>E-mail</th>
                <td><label for="textfield"></label>
                  <%=email %></td>
              </tr>
              <tr>
                <th>Phone Number</th>
                <td><%=cell_no %></td>
              </tr>
              <tr>
                <th>Date of Test</th>
                <td><%=reg_dt %></td>
              </tr>
              <tr>
                <th>Rater / Status</th>
                <td>
                <%if(level.equals("1") || level.equals("2")){ %>
              	<%if(!rater_id.equals("") && !rating_state.equals("Holding") || rating_state.equals("2")){ %>
                <%=rater_name %>
                <%}else{ %>
                <select name="rater" id="rater" style="width:100px" onchange="get_rater_chk('<%=member_test_code %>',this.value,'<%=sign_code %>','<%=link_id %>')">
                  <option value=''>Rater Select</option>
                <%
                if (list2!=null && list2.size()> 0) {
			    	for(int k=0; k<list2.size(); k++){
				      map2=(HashMap)list2.get(k);
				      cd = CommonUtil.nvl((String)map2.get("cd"));
				      cd_nm = CommonUtil.nvl((String)map2.get("cd_nm"));
				
				%>		        
                  <option value="<%=cd %>" <%=(rater_id.equals(cd))?"selected":"" %>><%=cd_nm %></option>
                <%
			    	}
                }
                %>  
                </select> <!-- <a href="#"><img src="img/btn_assign2.gif" alt="할당" border="0" align="middle" /></a> -->
                <%} %>
                <%}else{ %>
                <%=rater_name %>
                <%} %>
                
                &nbsp;&nbsp;/&nbsp;&nbsp;
                <%if(rating_state.equals("1")){ %>
                <img src="img/btn_progress.gif" alt="진행중" border="0" align="absmiddle" />
                <%}else if (rating_state.equals("2")){%>
                <img src="img/btn_complete.gif" alt="완료" border="0" align="absmiddle"/>
                <%}else if (rating_state.equals("9")){%>
                	재시험
                <%}else if (rating_state.equals("Holding")){%>
                <img src="img/btn_holding.gif" alt="홀딩" border="0" align="absmiddle"/>
                <%}else{ %>
                <img src='img/btn_ready.gif' alt='레디' border="0" align="absmiddle"/>
                <%} %>
                
                </td>
              </tr>    
              <tr>
                <th>average test scores</th>
                <td><%=avg_total %></td>
              </tr>    
              
              <tr>
                <th>Grade History</th>
                <td>
                <br>
                <table >
                	<tr>
                	<%
	                for(int i=0;i<ts_grade_cnt;i++){
	                %>
                	<td><b>Level <%=ts_grade_arr[i] %></b></td> 
					<%} %>
                	</tr>
                	<tr>
	                <%
	                for(int i=0;i<ts_grade_cnt;i++){
	                	rating_grade_cnt = "";
	                
		                if (list3!=null && list3.size()> 0) {
					    	for(int l=0; l<list3.size(); l++){
						      map3=(HashMap)list3.get(l);
						      if(ts_grade_arr[i].equals(CommonUtil.nvl((String)map3.get("rating_grade")))){
						    	  rating_grade_cnt =CommonUtil.nvl((String)map3.get("rating_grade_cnt"));
						      }
					    	}
		                }
	                %> 
	                <td><%=(!rating_grade_cnt.equals(""))?rating_grade_cnt:"0" %></td>
	                <%	
	                }
	                %>
	                </tr>
                </table>
                <br>
                </td>
              </tr>
              
              <tr>
                <th>Result View</th>
                <td>
                	
                	<input type="radio" name="result_view_yn" id="result_view_yn" value="Y" <%=(result_view_yn.equals("Y") || result_view_yn.equals("")?"checked":"") %>/>
                  	<span class="boldText">Yes </span>
                  	
                  	<input type="radio" name="result_view_yn" id="result_view_yn" value="N" <%=(result_view_yn.equals("N")?"checked":"") %>/>
                  	<span class="boldText">No </span>
					        
                </td>
              </tr>
               
            </table>
            <table class="CheckTb">
              <tr>
                <th width="50" rowspan="2">Speaking<br />question</th>
                <th width="60" rowspan="2">Record<br />file</th>
                <th width="122">pronunciation</th>
                <th width="122">Information<br />and stress</th>
                <th width="122">Grammar</th>
                <th width="122">Vocabulary</th>
                <th width="122">Cohesion</th>
                <th width="122">Relevance<br />of content</th>
                <th width="122">completeness<br />of content</th>
                <!-- 
                <th width="25" rowspan="2"><strong>Total</strong></th>
                <th width="25" rowspan="2"><strong>Avg</strong></th>
                 -->
              </tr>
              <tr>
                <th class="spacing3 grayBg"><strong>0 1 2 3 4 5</strong></th>
                <th class="spacing3 grayBg"><strong>0 1 2 3 4 5</strong></th>
                <th class="spacing3 grayBg"><strong>0 1 2 3 4 5</strong></th>
                <th class="spacing3 grayBg"><strong>0 1 2 3 4 5</strong></th>
                <th class="spacing3 grayBg"><strong>0 1 2 3 4 5</strong></th>
                <th class="spacing3 grayBg"><strong>0 1 2 3 4 5</strong></th>
                <th class="spacing3 grayBg"><strong>0 1 2 3 4 5</strong></th>
              </tr>
              <%
                String exam_num="";
                String member_test_answer_id="";
                String member_test_answer_nm="";
                String member_test_record_file_path="";
                String cont="";
                String explane_id="";
                String explane_nm="";
                String picture_id="";
                String picture_nm="";
                
                String q_1_sel = "";
                String q_2_sel = "";
                String q_3_sel = "";
                String q_4_sel = "";
                String q_5_sel = "";
                String q_6_sel = "";
                String q_7_sel = "";
                
                String disabled_gubun = "";
                
                int exam_num_int=0;
                
                for(int j=0 ; list1!=null && list1.size() > j ; j++){ 
        			map1 = (HashMap)list1.get(j);
        			exam_num = CommonUtil.nvl((String)map1.get("exam_num"));
        			member_test_answer_id = CommonUtil.nvl((String)map1.get("member_test_answer_id"));
        			member_test_answer_nm = CommonUtil.nvl((String)map1.get("member_test_answer_nm"));
        			member_test_record_file_path = CommonUtil.nvl((String)map1.get("member_test_record_file_path"));
        			cont = CommonUtil.nvl((String)map1.get("cont"));
        			
        			explane_id = CommonUtil.nvl((String)map1.get("explane_id"));
        			explane_nm = CommonUtil.nvl((String)map1.get("explane_nm"));
        			picture_id = CommonUtil.nvl((String)map1.get("picture_id"));
        			picture_nm = CommonUtil.nvl((String)map1.get("picture_nm"));
        			
        			exam_num_int = Integer.parseInt(exam_num);
        			
        			if(exam_num_int == 1 ){
        				q_1_sel = q1_1;
        				q_2_sel = q1_2;
        			}
        			
					if(exam_num_int == 2 ){
						q_1_sel = q2_1;
        				q_2_sel = q2_2;
        			}
					
					if(exam_num_int == 3 ){
						q_1_sel = q3_1;
        				q_2_sel = q3_2;
        				q_3_sel = q3_3;
        				q_4_sel = q3_4;
        				q_5_sel = q3_5;
        			}
					
					if(exam_num_int == 4 ){
						q_1_sel = q4_1;
        				q_2_sel = q4_2;
        				q_3_sel = q4_3;
        				q_4_sel = q4_4;
        				q_5_sel = q4_5;
        				q_6_sel = q4_6;
        				q_7_sel = q4_7;
        			}

					if(exam_num_int == 5 ){
						q_1_sel = q5_1;
        				q_2_sel = q5_2;
        				q_3_sel = q5_3;
        				q_4_sel = q5_4;
        				q_5_sel = q5_5;
        				q_6_sel = q5_6;
        				q_7_sel = q5_7;
					}
					
					if(exam_num_int == 6 ){
						q_1_sel = q6_1;
        				q_2_sel = q6_2;
        				q_3_sel = q6_3;
        				q_4_sel = q6_4;
        				q_5_sel = q6_5;
        				q_6_sel = q6_6;
        				q_7_sel = q6_7;
					}
					
					if(exam_num_int == 7 ){
						q_1_sel = q7_1;
        				q_2_sel = q7_2;
        				q_3_sel = q7_3;
        				q_4_sel = q7_4;
        				q_5_sel = q7_5;
        				q_6_sel = q7_6;
        				q_7_sel = q7_7;
					}
					
					if(exam_num_int == 8 ){
						q_1_sel = q8_1;
        				q_2_sel = q8_2;
        				q_3_sel = q8_3;
        				q_4_sel = q8_4;
        				q_5_sel = q8_5;
        				q_6_sel = q8_6;
        				q_7_sel = q8_7;
					}
					
					if(exam_num_int == 9 ){
						q_1_sel = q9_1;
        				q_2_sel = q9_2;
        				q_3_sel = q9_3;
        				q_4_sel = q9_4;
        				q_5_sel = q9_5;
        				q_6_sel = q9_6;
        				q_7_sel = q9_7;
					}
					
					if(exam_num_int == 10 ){
						q_1_sel = q10_1;
        				q_2_sel = q10_2;
        				q_3_sel = q10_3;
        				q_4_sel = q10_4;
        				q_5_sel = q10_5;
        				q_6_sel = q10_6;
        				q_7_sel = q10_7;
					}
					
					if(exam_num_int == 11 ){
						q_1_sel = q11_1;
        				q_2_sel = q11_2;
        				q_3_sel = q11_3;
        				q_4_sel = q11_4;
        				q_5_sel = q11_5;
        				q_6_sel = q11_6;
        				q_7_sel = q11_7;
					}
					
					if(exam_num_int<12){
						disabled_gubun = " disabled onclick='rating_sum()' ";
					}else{
						disabled_gubun = " onclick='rating_sum()' ";
					}
              %>
              <tr>
                <td>Q<%=exam_num %></td>
                <td>
                <!--  
                <a href="#q<%=exam_num %>" onclick="record_listen('<%=member_test_record_file_path%>/<%=member_test_answer_id%>')" name="q<%=exam_num %>"><img src="img/btn_listen.gif" alt="listen" border="0" /></a><br />
                <a href="#q<%=exam_num %>" onclick="go_download('<%=member_test_answer_id %>','<%=member_test_answer_nm %>','tstest')"><img src="img/btn_download.gif" alt="Download" border="0" /></a><br />
                -->
                <a href="#q<%=exam_num %>" onclick="record_listen('<%=member_test_record_file_path%>/<%=member_test_answer_id%>')" name="q<%=exam_num %>"><img src="img/btn_listen2.gif" alt="start" border="0" /></a><br />
                <a href="#q<%=exam_num %>" onclick="record_stop()" ><img src="img/btn_listen_end.gif" alt="stop"  align="middle"/></a><br />
                <a href="#q<%=exam_num %>" onclick="question_view('<%=exam_num %>')">Q<%=exam_num %> view</a>
                </td>
                <td>
                <input type="radio" <%=disabled_gubun %> name="q<%=exam_num %>_1"  value="0" <%=(q_1_sel.equals("0"))?"checked":"" %> onclick="question_result_sum(<%=exam_num %>)"/>
                <input type="radio" <%=disabled_gubun %> name="q<%=exam_num %>_1"  value="1" <%=(q_1_sel.equals("1"))?"checked":"" %> onclick="question_result_sum(<%=exam_num %>)"/>
                <input type="radio" <%=disabled_gubun %> name="q<%=exam_num %>_1"  value="2" <%=(q_1_sel.equals("2"))?"checked":"" %> onclick="question_result_sum(<%=exam_num %>)"/>
                <input type="radio" <%=disabled_gubun %> name="q<%=exam_num %>_1"  value="3" <%=(q_1_sel.equals("3"))?"checked":"" %> onclick="question_result_sum(<%=exam_num %>)"/>
                <%
                if(exam_num_int>9){                
                %>
                <input type="radio" <%=disabled_gubun %> name="q<%=exam_num %>_1"  value="4" <%=(q_1_sel.equals("4"))?"checked":"" %> onclick="question_result_sum(<%=exam_num %>)"/>
                <input type="radio" <%=disabled_gubun %> name="q<%=exam_num %>_1"  value="5" <%=(q_1_sel.equals("5"))?"checked":"" %> onclick="question_result_sum(<%=exam_num %>)"/>
                <%}else{ %>
				<input type="radio" <%=disabled_gubun %> name="q<%=exam_num %>_1"  value="4" disabled/>
                <input type="radio" <%=disabled_gubun %> name="q<%=exam_num %>_1"  value="5" disabled/>                
                <%} %>
                </td>
                
                <td>
                <input type="radio" <%=disabled_gubun %> name="q<%=exam_num %>_2"  value="0" <%=(q_2_sel.equals("0"))?"checked":"" %> onclick="question_result_sum(<%=exam_num %>)"/>
                <input type="radio" <%=disabled_gubun %>  name="q<%=exam_num %>_2"  value="1" <%=(q_2_sel.equals("1"))?"checked":"" %> onclick="question_result_sum(<%=exam_num %>)"/>
                <input type="radio" <%=disabled_gubun %>  name="q<%=exam_num %>_2"  value="2" <%=(q_2_sel.equals("2"))?"checked":"" %> onclick="question_result_sum(<%=exam_num %>)"/>
                <input type="radio" <%=disabled_gubun %>  name="q<%=exam_num %>_2"  value="3" <%=(q_2_sel.equals("3"))?"checked":"" %> onclick="question_result_sum(<%=exam_num %>)"/>
                <%
                if(exam_num_int>9){                
                %>
                <input type="radio" <%=disabled_gubun %>  name="q<%=exam_num %>_2"  value="4" <%=(q_2_sel.equals("4"))?"checked":"" %> onclick="question_result_sum(<%=exam_num %>)"/>
                <input type="radio" <%=disabled_gubun %>  name="q<%=exam_num %>_2"  value="5" <%=(q_2_sel.equals("5"))?"checked":"" %> onclick="question_result_sum(<%=exam_num %>)"/>
                <%}else{ %>
				<input type="radio" <%=disabled_gubun %>  name="q<%=exam_num %>_2"  value="4" disabled/>
                <input type="radio" <%=disabled_gubun %>  name="q<%=exam_num %>_2"  value="5" disabled/>                
                <%} %>
                </td>
                <%
                if(exam_num_int>2){                
                %>
                <td>
                <input type="radio" <%=disabled_gubun %>  name="q<%=exam_num %>_3"  value="0" <%=(q_3_sel.equals("0"))?"checked":"" %> onclick="question_result_sum(<%=exam_num %>)"/>
                <input type="radio" <%=disabled_gubun %>  name="q<%=exam_num %>_3"  value="1" <%=(q_3_sel.equals("1"))?"checked":"" %> onclick="question_result_sum(<%=exam_num %>)"/>
                <input type="radio" <%=disabled_gubun %>  name="q<%=exam_num %>_3"  value="2" <%=(q_3_sel.equals("2"))?"checked":"" %> onclick="question_result_sum(<%=exam_num %>)"/>
                <input type="radio" <%=disabled_gubun %>  name="q<%=exam_num %>_3"  value="3" <%=(q_3_sel.equals("3"))?"checked":"" %> onclick="question_result_sum(<%=exam_num %>)"/>
                <%
                if(exam_num_int>9){                
                %>
                <input type="radio" <%=disabled_gubun %>  name="q<%=exam_num %>_3"  value="4" <%=(q_3_sel.equals("4"))?"checked":"" %> onclick="question_result_sum(<%=exam_num %>)"/>
                <input type="radio" <%=disabled_gubun %>  name="q<%=exam_num %>_3"  value="5" <%=(q_3_sel.equals("5"))?"checked":"" %> onclick="question_result_sum(<%=exam_num %>)"/>
                <%}else{ %>
				<input type="radio" <%=disabled_gubun %>  name="q<%=exam_num %>_3"  value="4" disabled/>
                <input type="radio" <%=disabled_gubun %>  name="q<%=exam_num %>_3"  value="5" disabled/>                
                <%} %>
                </td>
                
                <td>
                <input type="radio" <%=disabled_gubun %>  name="q<%=exam_num %>_4"  value="0" <%=(q_4_sel.equals("0"))?"checked":"" %> onclick="question_result_sum(<%=exam_num %>)"/>
                <input type="radio" <%=disabled_gubun %>  name="q<%=exam_num %>_4"  value="1" <%=(q_4_sel.equals("1"))?"checked":"" %> onclick="question_result_sum(<%=exam_num %>)"/>
                <input type="radio" <%=disabled_gubun %>  name="q<%=exam_num %>_4"  value="2" <%=(q_4_sel.equals("2"))?"checked":"" %> onclick="question_result_sum(<%=exam_num %>)"/>
                <input type="radio" <%=disabled_gubun %>  name="q<%=exam_num %>_4"  value="3" <%=(q_4_sel.equals("3"))?"checked":"" %> onclick="question_result_sum(<%=exam_num %>)"/>
                <%
                if(exam_num_int>9){                
                %>
                <input type="radio" <%=disabled_gubun %>  name="q<%=exam_num %>_4"  value="4" <%=(q_4_sel.equals("4"))?"checked":"" %> onclick="question_result_sum(<%=exam_num %>)"/>
                <input type="radio" <%=disabled_gubun %>  name="q<%=exam_num %>_4"  value="5" <%=(q_4_sel.equals("5"))?"checked":"" %> onclick="question_result_sum(<%=exam_num %>)"/>
                <%}else{ %>
				<input type="radio" <%=disabled_gubun %>  name="q<%=exam_num %>_4"  value="4" disabled/>
                <input type="radio" <%=disabled_gubun %>  name="q<%=exam_num %>_4"  value="5" disabled/>                
                <%} %>
                </td>
               
                <td>
                <input type="radio" <%=disabled_gubun %>  name="q<%=exam_num %>_5"  value="0" <%=(q_5_sel.equals("0"))?"checked":"" %> onclick="question_result_sum(<%=exam_num %>)"/>
                <input type="radio" <%=disabled_gubun %>  name="q<%=exam_num %>_5"  value="1" <%=(q_5_sel.equals("1"))?"checked":"" %> onclick="question_result_sum(<%=exam_num %>)"/>
                <input type="radio" <%=disabled_gubun %>  name="q<%=exam_num %>_5"  value="2" <%=(q_5_sel.equals("2"))?"checked":"" %> onclick="question_result_sum(<%=exam_num %>)"/>
                <input type="radio" <%=disabled_gubun %>  name="q<%=exam_num %>_5"  value="3" <%=(q_5_sel.equals("3"))?"checked":"" %> onclick="question_result_sum(<%=exam_num %>)"/>
                <%
                if(exam_num_int>9){                
                %>
                <input type="radio" <%=disabled_gubun %>  name="q<%=exam_num %>_5"  value="4" <%=(q_5_sel.equals("4"))?"checked":"" %> onclick="question_result_sum(<%=exam_num %>)"/>
                <input type="radio" <%=disabled_gubun %>  name="q<%=exam_num %>_5"  value="5" <%=(q_5_sel.equals("5"))?"checked":"" %> onclick="question_result_sum(<%=exam_num %>)"/>
                <%}else{ %>
				<input type="radio" <%=disabled_gubun %>  name="q<%=exam_num %>_5"  value="4" disabled/>
                <input type="radio" <%=disabled_gubun %>  name="q<%=exam_num %>_5"  value="5" disabled/>                
                <%} %>
                </td>
                <%
                	if(exam_num_int>3){                
                %>
                <td>
                <input type="radio" <%=disabled_gubun %>  name="q<%=exam_num %>_6"  value="0" <%=(q_6_sel.equals("0"))?"checked":"" %> onclick="question_result_sum(<%=exam_num %>)"/>
                <input type="radio" <%=disabled_gubun %>  name="q<%=exam_num %>_6"  value="1" <%=(q_6_sel.equals("1"))?"checked":"" %> onclick="question_result_sum(<%=exam_num %>)"/>
                <input type="radio" <%=disabled_gubun %>  name="q<%=exam_num %>_6"  value="2" <%=(q_6_sel.equals("2"))?"checked":"" %> onclick="question_result_sum(<%=exam_num %>)"/>
                <input type="radio" <%=disabled_gubun %>  name="q<%=exam_num %>_6"  value="3" <%=(q_6_sel.equals("3"))?"checked":"" %> onclick="question_result_sum(<%=exam_num %>)"/>
                <%
                if(exam_num_int>9){                
                %>
                <input type="radio" <%=disabled_gubun %>  name="q<%=exam_num %>_6"  value="4" <%=(q_6_sel.equals("4"))?"checked":"" %> onclick="question_result_sum(<%=exam_num %>)"/>
                <input type="radio" <%=disabled_gubun %>  name="q<%=exam_num %>_6"  value="5" <%=(q_6_sel.equals("5"))?"checked":"" %> onclick="question_result_sum(<%=exam_num %>)"/>
                <%}else{ %>
				<input type="radio" <%=disabled_gubun %>  name="q<%=exam_num %>_6"  value="4" disabled/>
                <input type="radio" <%=disabled_gubun %>  name="q<%=exam_num %>_6"  value="5" disabled/>                
                <%} %>
                </td>
                
                <td>
                <input type="radio" <%=disabled_gubun %>  name="q<%=exam_num %>_7"  value="0" <%=(q_7_sel.equals("0"))?"checked":"" %> onclick="question_result_sum(<%=exam_num %>)"/>
                <input type="radio" <%=disabled_gubun %>  name="q<%=exam_num %>_7"  value="1" <%=(q_7_sel.equals("1"))?"checked":"" %> onclick="question_result_sum(<%=exam_num %>)"/>
                <input type="radio" <%=disabled_gubun %>  name="q<%=exam_num %>_7"  value="2" <%=(q_7_sel.equals("2"))?"checked":"" %> onclick="question_result_sum(<%=exam_num %>)"/>
                <input type="radio" <%=disabled_gubun %>  name="q<%=exam_num %>_7"  value="3" <%=(q_7_sel.equals("3"))?"checked":"" %> onclick="question_result_sum(<%=exam_num %>)"/>
                <%
                if(exam_num_int>9){                
                %>
                <input type="radio" <%=disabled_gubun %>  name="q<%=exam_num %>_7"  value="4" <%=(q_7_sel.equals("4"))?"checked":"" %> onclick="question_result_sum(<%=exam_num %>)"/>
                <input type="radio" <%=disabled_gubun %>  name="q<%=exam_num %>_7"  value="5" <%=(q_7_sel.equals("5"))?"checked":"" %> onclick="question_result_sum(<%=exam_num %>)"/>
                <%}else{ %>
				<input type="radio" <%=disabled_gubun %>  name="q<%=exam_num %>_7"  value="4" disabled/>
                <input type="radio" <%=disabled_gubun %>  name="q<%=exam_num %>_7"  value="5" disabled/>                
                <%} %>
                </td>
                
                <%
                	}else{
                
                %>
                <td></td>
                <td></td>
                <%		
                	}
                }else{ 
                %>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <%} %>
                <!--  
                <td class="blue11 grayBg">2</td>
                <td class="blue11 grayBg">10</td>
                -->
              </tr>
              <tr id="<%=exam_num %>_view" style="display:none">
              	<td colspan=9 >
              	
              	<table>
              		<td style="word-break:break-all;text-align:left;width:964px;">
              		<b>Q<%=exam_num %> view</b> <br>
              		<%if(!explane_id.equals("")){ %>
	                <a href="#q<%=exam_num %>" onclick="explane_listen('<%=explane_id%>')" ><img src="img/btn_listen.gif" alt="listen" border="0" /></a>
	                <%} %><br>
              		<%=cont %><br>
              		<%if(!picture_id.equals("")){ %>
	                <img src="/speaking.pb?cmd=download&file_id=<%=picture_id %>&file_name=<%=picture_id %>&file_folder=tsexam" >
	                <%} %>
	                
              		</td>
              	</table>
              	
              	</td>
              </tr>	
              <%} %>
              
              <!--  
              <tr>
                <th>Total</th>
                <td class="grayBg"></td>
                <td class="blue11 grayBg">2</td>
                <td class="blue11 grayBg">2</td>
                <td class="blue11 grayBg">2</td>
                <td class="blue11 grayBg">2</td>
                <td class="blue11 grayBg">2</td>
                <td class="blue11 grayBg">2</td>
                <td class="blue11 grayBg">2</td>
                <td colspan="2" rowspan="2" class="blue11 grayBg">2</td>
              </tr>
              <tr>
                <th>Avg</th>
                <td class="grayBg"></td>
                <td class="blue11 grayBg">2</td>
                <td class="blue11 grayBg">2</td>
                <td class="blue11 grayBg">2</td>
                <td class="blue11 grayBg">2</td>
                <td class="blue11 grayBg">2</td>
                <td class="blue11 grayBg">2</td>
                <td class="blue11 grayBg">2</td>
              </tr>
              -->
            </table>
            <table class="setupTb">
              <tr>
                <th >Total</th>
                
                <td >
                <input type="text" style="width:40px" name="part_total" value="<%=(part_total.equals(""))?"0":part_total %>">
                <!--  
                <b>part 1 (Q1~2)</b> <br>Percent (%) <input name="part1_sum"  id="part1_sum" type="text" style="width:30px" value="<%=part1_sum %>" readonly/><br />
                  <span class="comment">
                  <textarea name="part1" id="part1" type="textarea"  rows="5" style="width:400px" value="" /><%=part1 %></textarea>
                </span> 
                <br/>
                <b>part 2 (Q3)</b> <br>Percent (%) <input name="part2_sum" id="part2_sum" type="text" style="width:30px" value="<%=part2_sum %>" readonly/><br />
                  <span class="comment">
                  <textarea name="part2" id="part2" type="textarea"  rows="5" style="width:400px" value="" /><%=part2 %></textarea>
                </span>
                <br/>
                <b>part 3 (Q4~6)</b> <br>Percent (%) <input name="part3_sum" id="part3_sum" type="text" style="width:30px" value="<%=part3_sum %>" readonly/><br />
                  <span class="comment">
                  <textarea name="part3" id="part3" type="textarea"  rows="5" style="width:400px" value="" /><%=part3 %></textarea>
                </span>
                <br/>
                <b>part 4 (Q7~9)</b> <br>Percent (%) <input name="part4_sum" id="part4_sum" type="text" style="width:30px" value="<%=part4_sum %>" readonly/><br />
                  <span class="comment">
                  <textarea name="part4" id="part4" type="textarea"  rows="5" style="width:400px" value="" /><%=part4 %></textarea>
                </span>
                <br/>
                <b>part 5 (Q10)</b> <br>Percent (%) <input name="part5_sum" id="part5_sum" type="text" style="width:30px" value="<%=part5_sum %>" readonly/><br />
                  <span class="comment">
                  <textarea name="part5" id="part5" type="textarea"  rows="5" style="width:400px" value="" /><%=part5 %></textarea>
                </span>
                <br/>
                <b>part 6 (Q11)</b> <br>Percent (%) <input name="part6_sum" id="part6_sum" type="text" style="width:30px" value="<%=part6_sum %>" readonly/><br />
                  <span class="comment">
                  <textarea name="part6" id="part6" type="textarea"  rows="5" style="width:400px" value="" /><%=part6 %></textarea>
                </span>
                <br/>
                -->
                </td>
              </tr>
              
             
              <tr style="display:none" id="unrating_comment">
                <th>UnRating Reason</th>
                <td><textarea name="rerating_reason" rows="5" id="rerating_reason" style="width:450px"></textarea></td>
              </tr>
            </table>
                      
            <p><%if (!rating_state.equals("2")){ %><a href="#" onclick="go_input()"><img src="img/btn_rating.gif" alt="rating"  /></a> <a href="#" onclick="go_rerating()"><img src="img/btn_unrating.gif" alt="unrating"  /></a><%}else{ %><a href="#" onclick="go_input()"><img src="img/btn_rating.gif" alt="rating"  /></a><%} %> <a href="#" onclick="go_tstest()"><img src="img/btn_list_eng.gif" alt="목록" width="49" height="20" /></a> </p>
          </div>
          
        </div>
      </div>


<input type="hidden" name="cmd" value="">
<input type="hidden" name="user_id" value="<%=user_id %>">
<input type="hidden" name="member_id" value="<%=member_id %>">
<input type="hidden" name="member_test_code" value="<%=member_test_code %>">


<input type="hidden" name="sign_code" value="<%=sign_code %>">
<input type="hidden" name="link_id" value="<%=link_id %>">
</form>

<form name="moveform"  method="post" action = "/speaking.pb" >
<input type="hidden" name="cmd" value="">
<input type="hidden" name="user_id" value="<%=user_id %>">
<input type="hidden" name="line_number" value="<%=line_number%>">
<input type="hidden" name="curr_page" value="<%=curr_page%>">
<input type="hidden" name="total_count" value="<%=total_count%>">

<input type="hidden" name="rating_state" value="<%=s_rating_state%>">
<input type="hidden" name="search_combo" value="<%=search_combo%>">
<input type="hidden" name="keyword" value="<%=keyword%>">

<input type="hidden" name="start_date" value="<%=start_date%>">
<input type="hidden" name="end_date" value="<%=end_date%>">
</form>

<form name="downform"  method="post" action = "/speaking.pb" >
<input type="hidden" name="cmd" value="">
<input type="hidden" name="file_id" >
<input type="hidden" name="file_name" >
<input type="hidden" name="file_folder" >
</form>

<iframe name='hidden_frm'  width='0' height='0' SCROLLING='AUTO' frameborder='0'></iframe>

<script>
Mplayer_Player_Base();
</script>
<jsp:include page="/jsp/common/footer.jsp"></jsp:include>
<jsp:include page="/jsp/common/bottom.jsp"></jsp:include>
